<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>注册页面</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
  </head>
  
  <body>
    <div>
    	<form id="myform" action="user_register.do" method="post">
    		<table>
    			<tr>
    				<td>邮箱:</td>
    				<td><input type="text" name="user.uemail" />&nbsp;&nbsp;&nbsp;&nbsp;用于登陆和找回密码...</td>
    			</tr>
    			<tr>
    				<td>昵称:</td>
    				<td><input type="text" name="user.uname" /></td>
    			</tr>
    			<tr>
    				<td>密码:</td>
    				<td><input type="password" name="user.passwd" id="password" /></td>
    			</tr>
    			<tr>
    				<td>确认密码:</td>
    				<td><input type="password" id="confirm" /></td>
    				<td>
    					 <input type="text" name="userCaptchaResponse" value="" />
    					<img id="captcha" src="captcha.jpg" width="100" height="50" />
    					<a href="javascript:void(0);" onclick="changeImg();">换图</a>
    				</td>
    			</tr>
    			<tr>
    				<td><a href="javascript:void(0);" onclick="register();">注册</a></td>
    			</tr>
    		</table>
    	</form>
    </div>
  </body>
  <script type="text/javascript">
  	function register(){
  		fm = document.getElementById("myform");
  		var password = document.getElementById("password").value;
  		var confirm = document.getElementById("confirm").value;
  		if(password == confirm) {
  			fm.submit();
  		}else {
  			alert("两次输入密码不一致啊！");
  		}
  	}
  	function changeImg() {
  		document.getElementById("captcha").src = "captcha.jpg?chg" + Math.random();
  	}
  </script>
</html>
